<?php
class Mlogin extends CI_Model{

	var $table = 'profil_pemandu';
	
	function cek_user($user, $password){
		$query = $this->db->get_where($this->table, array('user' => $user, 'password' => $this->encrypt->SHA1($password)));
		if ($query->num_rows() > 0)
		{
			return TRUE;
		}
		else
		{
			return FALSE;
		}
	}
	
	function get_id($user){
		$this->db->select('profil_pemandu.id_pemandu');
		$this->db->from($this->table);
		$this->db->where('profil_pemandu.user', $user);
		return $this->db->get()->result();
	}

	function siapa($user)
	{
		$this->db->select('profil_pemandu.id_pemandu, profil_pemandu.user, profil_pemandu.tipe_user');
		$this->db->from($this->table);
		$this->db->where('profil_pemandu.user', $user);
		return $this->db->get()->result();
	}
	
}
?>
